<template>
	<view class="message-container">
		<view class="message-body" v-for="(item,index)  in listData" :key="index">
			<view class="message-img">
				<image src="../../../static/img/jinggao_o.png" mode="" class="content-img"></image>
				<text>{{item.text1}}</text>
			</view>
			<text>{{item.text2}}</text>
			<view class="message-text">
				<text>2019-09-08 12:10:56</text>
				<text>{{item.text3}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				listData:[{
					text1:"移动预警提醒",
					text2:"李小凤 离开了电子围栏:黄浦江围栏",
					text3:"详情 >"
				},
				{
					text1:"移动预警提醒",
					text2:"李小凤 进入了电子围栏:黄浦江围栏",
					text3:"详情 >"
				}
				],
				listData1:[{
					text1:"移动预警提醒",
					text2:"李小凤 离开了电子围栏:黄浦江围栏",
					text3:"详情 >"
				},
				{
					text1:"移动预警提醒",
					text2:"李小凤 进入了电子围栏:黄浦江围栏",
					text3:"详情 >"
				}]
			}
		},
		methods: {
			
		},
		onNavigationBarButtonTap:function(e){
			if(e.text=="清空"){
				this.listData=""
			}
		},
		onLoad: function (options) {
		        setTimeout(function () {
		            console.log('start pulldown');
		        }, 1000);
		        uni.startPullDownRefresh();
		    },
		    onPullDownRefresh() {
		        console.log('refresh');
			    this.listData=""
		        setTimeout( ()=> {
					this.listData=this.listData1
		            uni.stopPullDownRefresh();
		        }, 1000);
		    }
	}
</script>

<style lang="less" scoped>
.message-container{
	
	flex-direction: column;
	width: 100%;
	display: flex;
	align-items: center;
}
.message-body{
	display: flex;
	flex-direction: column;
	justify-content:space-around;	
	width: 94%;
	height: 130px;
	box-shadow: 0 0 4px #555153;
	border-radius: 4px;
	margin-top: 10px;
}
.message-text{
	display: flex;
	flex-direction: row;
	justify-content: space-between;
}
.message-img{
	display: flex;
	flex-direction: row;
	& .content-img{
		width: 22px;
		height: 22px;
	}
}
</style>
